package com.ruoyi.common.core.enums;


import com.ruoyi.common.core.exception.ResourceUnsupportedException;

import java.util.Objects;

/**
 * 国家地区枚举
 */
public enum CountryEnum {
    AC("AC","ASC","Ascension Island (British)","阿森松岛(英国)", CurrencyEnum.USD),
    AD("AD","AND","Andorra","安道尔共和国", CurrencyEnum.USD),
    AE("AE","ARE","United Arab Emirates","阿拉伯联合酋长国", CurrencyEnum.USD),
    AF("AF","AFG","Afghanistan","阿富汗", CurrencyEnum.USD),
    AG("AG","ATG","Antigua and Barbuda","安提瓜和巴布达", CurrencyEnum.USD),
    AI("AI","AIA","Anguilla","安圭拉岛", CurrencyEnum.USD),
    AL("AL","ALB","Albania","阿尔巴尼亚", CurrencyEnum.USD),
    AM("AM","ARM","Armenia","亚美尼亚", CurrencyEnum.USD),
    AN("AN","ANT","Netherlands Antilles","荷属安的列斯群岛", CurrencyEnum.USD),
    AO("AO","AGO","Angola","安哥拉", CurrencyEnum.USD),
    AQ("AQ","ATA","Antarctica","南极洲", CurrencyEnum.USD),
    AR("AR","ARG","Argentina","阿根廷", CurrencyEnum.USD),
    AS("AS","ASM","American Samoa","美属萨摩亚", CurrencyEnum.USD),
    AT("AT","AUT","Austria","奥地利", CurrencyEnum.USD),
    AU("AU","AUS","Australia","澳大利亚", CurrencyEnum.USD),
    AW("AW","ABW","Aruba","阿鲁巴", CurrencyEnum.USD),
    AX("AX","ALA","Aaland Islands","Aaland群岛", CurrencyEnum.USD),
    AZ("AZ","AZE","Azerbaijan","阿塞拜疆", CurrencyEnum.USD),
    BA("BA","BIH","Bosnia and Herzegovina","波斯尼亚和黑塞哥维那", CurrencyEnum.USD),
    BB("BB","BRB","Barbados","巴巴多斯", CurrencyEnum.USD),
    BD("BD","BGD","Bangladesh","孟加拉国", CurrencyEnum.USD),
    BE("BE","BEL","Belgium","比利时", CurrencyEnum.USD),
    BF("BF","BFA","Burkina Faso","布基纳法索", CurrencyEnum.USD),
    BG("BG","BGR","Bulgaria","保加利亚", CurrencyEnum.USD),
    BH("BH","BHR","Bahrain","巴林", CurrencyEnum.USD),
    BI("BI","BDI","Burundi","布隆迪", CurrencyEnum.USD),
    BJ("BJ","BEN","Benin","贝宁", CurrencyEnum.USD),
    BL("BL","BLM","St. Barthelemy","圣巴特尔米", CurrencyEnum.USD),
    BM("BM","BMU","Bermuda","百慕大群岛", CurrencyEnum.USD),
    BN("BN","BRN","Brunei Darussalam","文莱", CurrencyEnum.BND),
    BO("BO","BOL","Bolivia","玻利维亚", CurrencyEnum.USD),
    BQ("BQ","BES","Bonaire, Sint Eustatius and Saba","博内尔，圣尤斯特提乌斯和萨巴", CurrencyEnum.USD),
    BR("BR","BRA","Brazil","巴西", CurrencyEnum.USD),
    BS("BS","BHS","Bahamas","巴哈马", CurrencyEnum.USD),
    BT("BT","BTN","Bhutan","不丹", CurrencyEnum.BTN),
    BV("BV","BVT","Bouvet Island","布韦岛", CurrencyEnum.USD),
    BW("BW","BWA","Botswana","博茨瓦纳", CurrencyEnum.USD),
    BY("BY","BLR","Belarus","白俄罗斯", CurrencyEnum.USD),
    BZ("BZ","BLZ","Belize","伯利兹", CurrencyEnum.USD),
    CA("CA","CAN","Canada","加拿大", CurrencyEnum.CAD),
    CC("CC","CCK","Cocos (Keeling) Islands","科科斯（基林）群岛", CurrencyEnum.USD),
    CD("CD","COD","Democratic Republic of Congo","刚果民主共和国", CurrencyEnum.USD),
    CF("CF","CAF","Central African Republic","中非共和国", CurrencyEnum.USD),
    CG("CG","COG","Congo","刚果", CurrencyEnum.USD),
    CH("CH","CHE","Switzerland","瑞士", CurrencyEnum.CHF),
    CI("CI","CIV","Cote D'Ivoire","科特迪瓦", CurrencyEnum.USD),
    CK("CK","COK","Cook Islands","库克群岛", CurrencyEnum.USD),
    CL("CL","CHL","Chile","智利", CurrencyEnum.USD),
    CM("CM","CMR","Cameroon","喀麦隆", CurrencyEnum.USD),
    CN("CN","CHN","China","中国", CurrencyEnum.CNY),
    CO("CO","COL","Colombia","哥伦比亚", CurrencyEnum.USD),
    CR("CR","CRI","Costa Rica","哥斯达黎加", CurrencyEnum.USD),
    CU("CU","CUB","Cuba","古巴", CurrencyEnum.USD),
    CV("CV","CPV","Cape Verde","佛得角", CurrencyEnum.USD),
    CW("CW","CUW","Curacao","库拉索岛", CurrencyEnum.USD),
    CX("CX","CXR","Christmas Island","圣诞岛", CurrencyEnum.USD),
    CY("CY","CYP","Cyprus","塞浦路斯", CurrencyEnum.USD),
    CZ("CZ","CZE","Czech Republic","捷克", CurrencyEnum.USD),
    DE("DE","DEU","Germany","德国", CurrencyEnum.USD),
    DJ("DJ","DJI","Djibouti","吉布提", CurrencyEnum.USD),
    DK("DK","DNK","Denmark","丹麦", CurrencyEnum.DKK),
    DM("DM","DMA","Dominica","多米尼加", CurrencyEnum.USD),
    DO("DO","DOM","Dominican Republic","多米尼加共和国", CurrencyEnum.USD),
    DZ("DZ","DZA","Algeria","阿尔及利亚", CurrencyEnum.USD),
    EC("EC","ECU","Ecuador","厄瓜多尔", CurrencyEnum.USD),
    EE("EE","EST","Estonia","爱沙尼亚", CurrencyEnum.USD),
    EG("EG","EGY","Egypt","埃及", CurrencyEnum.USD),
    EH("EH","ESH","Western Sahara","西撒哈拉", CurrencyEnum.USD),
    ER("ER","ERI","Eritrea","厄立特里亚", CurrencyEnum.USD),
    ES("ES","ESP","Spain","西班牙", CurrencyEnum.USD),
    ET("ET","ETH","Ethiopia","埃塞俄比亚", CurrencyEnum.USD),
    FI("FI","FIN","Finland","芬兰", CurrencyEnum.USD),
    FJ("FJ","FJI","Fiji","斐济", CurrencyEnum.USD),
    FK("FK","FLK","Falkland Islands (Malvinas)","福克兰群岛（马尔维纳斯）", CurrencyEnum.USD),
    FM("FM","FSM","Micronesia, Federated States of","密克罗尼西亚联邦", CurrencyEnum.USD),
    FO("FO","FRO","Faroe Islands","法罗群岛", CurrencyEnum.USD),
    FR("FR","FRA","France, Metropolitan","法国", CurrencyEnum.USD),
    GA("GA","GAB","Gabon","加蓬", CurrencyEnum.USD),
    GB("GB","GBR","United Kingdom","英国", CurrencyEnum.USD),
    GD("GD","GRD","Grenada","格林纳达", CurrencyEnum.USD),
    GE("GE","GEO","Georgia","格鲁吉亚", CurrencyEnum.USD),
    GF("GF","GUF","French Guiana","法属圭亚那", CurrencyEnum.USD),
    GG("GG","GGY","Guernsey","根西岛", CurrencyEnum.USD),
    GH("GH","GHA","Ghana","加纳", CurrencyEnum.USD),
    GI("GI","GIB","Gibraltar","直布罗陀", CurrencyEnum.USD),
    GL("GL","GRL","Greenland","格陵兰岛", CurrencyEnum.USD),
    GM("GM","GMB","Gambia","冈比亚", CurrencyEnum.USD),
    GN("GN","GIN","Guinea","几内亚", CurrencyEnum.USD),
    GP("GP","GLP","Guadeloupe","瓜德罗普岛", CurrencyEnum.USD),
    GQ("GQ","GNQ","Equatorial Guinea","赤道几内亚", CurrencyEnum.USD),
    GR("GR","GRC","Greece","希腊", CurrencyEnum.USD),
    GS("GS","SGS","South Georgia &amp; South Sandwich Islands","南乔治亚和南桑威奇群岛", CurrencyEnum.USD),
    GT("GT","GTM","Guatemala","危地马拉", CurrencyEnum.USD),
    GU("GU","GUM","Guam","关岛", CurrencyEnum.USD),
    GW("GW","GNB","Guinea-Bissau","几内亚比绍", CurrencyEnum.USD),
    GY("GY","GUY","Guyana","圭亚那", CurrencyEnum.USD),
    HK("HK","HKG","Hong Kong","香港", CurrencyEnum.HKD),
    HM("HM","HMD","Heard and Mc Donald Islands","赫德和麦克唐纳群岛", CurrencyEnum.USD),
    HN("HN","HND","Honduras","洪都拉斯", CurrencyEnum.USD),
    HR("HR","HRV","Croatia","克罗地亚", CurrencyEnum.USD),
    HT("HT","HTI","Haiti","海地", CurrencyEnum.USD),
    HU("HU","HUN","Hungary","匈牙利", CurrencyEnum.USD),
    IC("IC","ICA","Canary Islands","金丝雀群岛", CurrencyEnum.USD),
    ID("ID","IDN","Indonesia","印度尼西亚", CurrencyEnum.USD),
    IE("IE","IRL","Ireland","爱尔兰", CurrencyEnum.USD),
    IL("IL","ISR","Israel","以色列", CurrencyEnum.USD),
    IM("IM","IMN","Isle of Man","英国属地曼岛", CurrencyEnum.USD),
    IN("IN","IND","India","印度", CurrencyEnum.INR),
    IO("IO","IOT","British Indian Ocean Territory","英属印度洋领土", CurrencyEnum.USD),
    IQ("IQ","IRQ","Iraq","伊拉克", CurrencyEnum.USD),
    IR("IR","IRN","Iran (Islamic Republic of)","伊朗", CurrencyEnum.USD),
    IS("IS","ISL","Iceland","冰岛", CurrencyEnum.USD),
    IT("IT","ITA","Italy","意大利", CurrencyEnum.USD),
    JE("JE","JEY","Jersey","泽西岛", CurrencyEnum.USD),
    JM("JM","JAM","Jamaica","牙买加", CurrencyEnum.USD),
    JO("JO","JOR","Jordan","约旦", CurrencyEnum.USD),
    JP("JP","JPN","Japan","日本", CurrencyEnum.JPY),
    KE("KE","KEN","Kenya","肯尼亚", CurrencyEnum.USD),
    KG("KG","KGZ","Kyrgyzstan","吉尔吉斯坦", CurrencyEnum.USD),
    KH("KH","KHM","Cambodia","柬埔寨", CurrencyEnum.KHR),
    KI("KI","KIR","Kiribati","基里巴斯", CurrencyEnum.USD),
    KM("KM","COM","Comoros","科摩罗", CurrencyEnum.USD),
    KN("KN","KNA","Saint Kitts and Nevis","圣基茨和尼维斯", CurrencyEnum.USD),
    KP("KP","PRK","North Korea","朝鲜", CurrencyEnum.KPW),
    KR("KR","KOR","South Korea","韩国", CurrencyEnum.KRW),
    KW("KW","KWT","Kuwait","科威特", CurrencyEnum.USD),
    KY("KY","CYM","Cayman Islands","开曼群岛", CurrencyEnum.USD),
    KZ("KZ","KAZ","Kazakhstan","哈萨克斯坦", CurrencyEnum.USD),
    LA("LA","LAO","Lao People's Democratic Republic","老挝", CurrencyEnum.LAK),
    LB("LB","LBN","Lebanon","黎巴嫩", CurrencyEnum.USD),
    LC("LC","LCA","Saint Lucia","圣卢西亚", CurrencyEnum.USD),
    LI("LI","LIE","Liechtenstein","列支敦士登", CurrencyEnum.USD),
    LK("LK","LKA","Sri Lanka","斯里兰卡", CurrencyEnum.USD),
    LR("LR","LBR","Liberia","利比里亚", CurrencyEnum.USD),
    LS("LS","LSO","Lesotho","莱索托", CurrencyEnum.USD),
    LT("LT","LTU","Lithuania","立陶宛", CurrencyEnum.USD),
    LU("LU","LUX","Luxembourg","卢森堡", CurrencyEnum.USD),
    LV("LV","LVA","Latvia","拉脱维亚", CurrencyEnum.USD),
    LY("LY","LBY","Libyan Arab Jamahiriya","利比亚", CurrencyEnum.USD),
    MA("MA","MAR","Morocco","摩洛哥", CurrencyEnum.USD),
    MC("MC","MCO","Monaco","摩纳哥", CurrencyEnum.USD),
    MD("MD","MDA","Moldova, Republic of","摩尔多瓦", CurrencyEnum.USD),
    ME("ME","MNE","Montenegro","黑山共和国", CurrencyEnum.USD),
    MF("MF","MAF","St. Martin (French part)","圣马丁", CurrencyEnum.USD),
    MG("MG","MDG","Madagascar","马达加斯加", CurrencyEnum.USD),
    MH("MH","MHL","Marshall Islands","马绍尔群岛", CurrencyEnum.USD),
    MK("MK","MKD","FYROM","马其顿共和国", CurrencyEnum.USD),
    ML("ML","MLI","Mali","马里", CurrencyEnum.USD),
    MM("MM","MMR","Myanmar","缅甸", CurrencyEnum.MMK),
    MN("MN","MNG","Mongolia","蒙古", CurrencyEnum.MNT),
    MO("MO","MAC","Macau","澳门", CurrencyEnum.MOP),
    MP("MP","MNP","Northern Mariana Islands","北马里亚纳群岛", CurrencyEnum.USD),
    MQ("MQ","MTQ","Martinique","马提尼克岛", CurrencyEnum.USD),
    MR("MR","MRT","Mauritania","毛里塔尼亚", CurrencyEnum.USD),
    MS("MS","MSR","Montserrat","蒙特塞拉特岛", CurrencyEnum.USD),
    MT("MT","MLT","Malta","马耳他", CurrencyEnum.USD),
    MU("MU","MUS","Mauritius","毛里求斯", CurrencyEnum.USD),
    MV("MV","MDV","Maldives","马尔代夫", CurrencyEnum.USD),
    MW("MW","MWI","Malawi","马拉维", CurrencyEnum.USD),
    MX("MX","MEX","Mexico","墨西哥", CurrencyEnum.USD),
    MY("MY","MYS","Malaysia","马来西亚", CurrencyEnum.MYR),
    MZ("MZ","MOZ","Mozambique","莫桑比克", CurrencyEnum.USD),
    NA("NA","NAM","Namibia","纳米比亚", CurrencyEnum.USD),
    NC("NC","NCL","New Caledonia","新喀里多尼亚", CurrencyEnum.USD),
    NE("NE","NER","Niger","尼日尔", CurrencyEnum.USD),
    NF("NF","NFK","Norfolk Island","诺福克岛", CurrencyEnum.USD),
    NG("NG","NGA","Nigeria","尼日利亚", CurrencyEnum.USD),
    NI("NI","NIC","Nicaragua","尼加拉瓜", CurrencyEnum.USD),
    NL("NL","NLD","Netherlands","荷兰", CurrencyEnum.USD),
    NO("NO","NOR","Norway","挪威", CurrencyEnum.NOK),
    NP("NP","NPL","Nepal","尼泊尔", CurrencyEnum.NPR),
    NR("NR","NRU","Nauru","瑙鲁", CurrencyEnum.USD),
    NU("NU","NIU","Niue","纽埃", CurrencyEnum.USD),
    NZ("NZ","NZL","New Zealand","新西兰", CurrencyEnum.NZD),
    OM("OM","OMN","Oman","阿曼", CurrencyEnum.USD),
    PA("PA","PAN","Panama","巴拿马", CurrencyEnum.USD),
    PE("PE","PER","Peru","秘鲁", CurrencyEnum.USD),
    PF("PF","PYF","French Polynesia","法属玻利尼西亚", CurrencyEnum.USD),
    PG("PG","PNG","Papua New Guinea","巴布亚新几内亚", CurrencyEnum.USD),
    PH("PH","PHL","Philippines","菲律宾", CurrencyEnum.PHP),
    PK("PK","PAK","Pakistan","巴基斯坦", CurrencyEnum.PKR),
    PL("PL","POL","Poland","波兰", CurrencyEnum.USD),
    PM("PM","SPM","St. Pierre and Miquelon","圣皮埃尔和密克隆", CurrencyEnum.USD),
    PN("PN","PCN","Pitcairn","皮特凯恩", CurrencyEnum.USD),
    PR("PR","PRI","Puerto Rico","波多黎各", CurrencyEnum.USD),
    PS("PS","PSE","Palestinian Territory, Occupied","巴勒斯坦,占领", CurrencyEnum.USD),
    PT("PT","PRT","Portugal","葡萄牙", CurrencyEnum.USD),
    PW("PW","PLW","Palau","帕劳群岛", CurrencyEnum.USD),
    PY("PY","PRY","Paraguay","巴拉圭", CurrencyEnum.USD),
    QA("QA","QAT","Qatar","卡塔尔", CurrencyEnum.USD),
    RE("RE","REU","Reunion","留尼汪", CurrencyEnum.USD),
    RO("RO","ROM","Romania","罗马尼亚", CurrencyEnum.USD),
    RS("RS","SRB","Serbia","塞尔维亚", CurrencyEnum.USD),
    RU("RU","RUS","Russian Federation","俄罗斯", CurrencyEnum.USD),
    RW("RW","RWA","Rwanda","卢旺达", CurrencyEnum.USD),
    SA("SA","SAU","Saudi Arabia","沙特阿拉伯", CurrencyEnum.USD),
    SB("SB","SLB","Solomon Islands","所罗门群岛", CurrencyEnum.USD),
    SC("SC","SYC","Seychelles","塞舌尔", CurrencyEnum.USD),
    SD("SD","SDN","Sudan","苏丹", CurrencyEnum.USD),
    SE("SE","SWE","Sweden","瑞典", CurrencyEnum.SEK),
    SG("SG","SGP","Singapore","新加坡", CurrencyEnum.SGD),
    SH("SH","SHN","St. Helena","圣赫勒拿", CurrencyEnum.USD),
    SI("SI","SVN","Slovenia","斯洛文尼亚", CurrencyEnum.USD),
    SJ("SJ","SJM","Svalbard and Jan Mayen Islands","斯瓦尔巴群岛和扬马延群岛", CurrencyEnum.USD),
    SK("SK","SVK","Slovak Republic","斯洛伐克", CurrencyEnum.USD),
    SL("SL","SLE","Sierra Leone","塞拉利昂", CurrencyEnum.USD),
    SM("SM","SMR","San Marino","圣马力诺", CurrencyEnum.USD),
    SN("SN","SEN","Senegal","塞内加尔", CurrencyEnum.USD),
    SO("SO","SOM","Somalia","索马里", CurrencyEnum.USD),
    SR("SR","SUR","Suriname","苏里南", CurrencyEnum.USD),
    SS("SS","SSD","South Sudan","南苏丹", CurrencyEnum.USD),
    ST("ST","STP","Sao Tome and Principe","圣多美和普林西比", CurrencyEnum.USD),
    SV("SV","SLV","El Salvador","萨尔瓦多", CurrencyEnum.USD),
    SY("SY","SYR","Syrian Arab Republic","叙利亚", CurrencyEnum.USD),
    SZ("SZ","SWZ","Swaziland","斯威士兰", CurrencyEnum.USD),
    TA("TA","SHN","Tristan da Cunha","特里斯坦-达库尼亚群岛", CurrencyEnum.USD),
    TC("TC","TCA","Turks and Caicos Islands","特克斯科斯群岛", CurrencyEnum.USD),
    TD("TD","TCD","Chad","乍得", CurrencyEnum.USD),
    TF("TF","ATF","French Southern Territories","法属南部领地", CurrencyEnum.USD),
    TG("TG","TGO","Togo","多哥", CurrencyEnum.USD),
    TH("TH","THA","Thailand","泰国", CurrencyEnum.THB),
    TJ("TJ","TJK","Tajikistan","塔吉克斯坦", CurrencyEnum.USD),
    TK("TK","TKL","Tokelau","托克劳群岛", CurrencyEnum.USD),
    TL("TL","TLS","East Timor","东帝汶阿拉霍尼", CurrencyEnum.USD),
    TM("TM","TKM","Turkmenistan","土库曼斯坦", CurrencyEnum.USD),
    TN("TN","TUN","Tunisia","突尼斯", CurrencyEnum.USD),
    TO("TO","TON","Tonga","汤加", CurrencyEnum.USD),
    TR("TR","TUR","Turkey","土耳其", CurrencyEnum.USD),
    TT("TT","TTO","Trinidad and Tobago","特立尼达和多巴哥", CurrencyEnum.USD),
    TV("TV","TUV","Tuvalu","吐瓦鲁", CurrencyEnum.USD),
    TW("TW","TWN","Taiwan","台湾", CurrencyEnum.TWD),
    TZ("TZ","TZA","Tanzania, United Republic of","坦桑尼亚", CurrencyEnum.USD),
    UA("UA","UKR","Ukraine","乌克兰", CurrencyEnum.USD),
    UG("UG","UGA","Uganda","乌干达", CurrencyEnum.USD),
    UM("UM","UMI","United States Minor Outlying Islands","美国本土外小岛屿", CurrencyEnum.USD),
    US("US","USA","United States","美国", CurrencyEnum.USD),
    UY("UY","URY","Uruguay","乌拉圭", CurrencyEnum.USD),
    UZ("UZ","UZB","Uzbekistan","乌兹别克斯坦", CurrencyEnum.USD),
    VA("VA","VAT","Vatican City State (Holy See)","梵蒂冈", CurrencyEnum.USD),
    VC("VC","VCT","Saint Vincent and the Grenadines","圣文森特", CurrencyEnum.USD),
    VE("VE","VEN","Venezuela","委内瑞拉", CurrencyEnum.USD),
    VG("VG","VGB","Virgin Islands (British)","维尔京群岛(英国)", CurrencyEnum.USD),
    VI("VI","VIR","Virgin Islands (U.S.)","维尔京群岛(美国)", CurrencyEnum.USD),
    VN("VN","VNM","Viet Nam","越南", CurrencyEnum.VND),
    VU("VU","VUT","Vanuatu","瓦努阿图", CurrencyEnum.USD),
    WF("WF","WLF","Wallis and Futuna Islands","瓦利斯群岛和富图纳群岛", CurrencyEnum.USD),
    WS("WS","WSM","Samoa","萨摩亚", CurrencyEnum.USD),
    XK("XK","UNK","Kosovo, Republic of","科索沃共和国", CurrencyEnum.USD),
    YE("YE","YEM","Yemen","也门", CurrencyEnum.USD),
    YT("YT","MYT","Mayotte","马约特", CurrencyEnum.USD),
    ZA("ZA","ZAF","South Africa","南非", CurrencyEnum.ZAR),
    ZM("ZM","ZMB","Zambia","赞比亚", CurrencyEnum.USD),
    ZW("ZW","ZWE","Zimbabwe","津巴布韦", CurrencyEnum.USD);

    private final String iso;
    private final String iso2;
    private final String nameEn;
    private final String nameCn;
    private final CurrencyEnum mainCurrency;

    CountryEnum(String iso, String iso2, String nameEn, String nameCn, CurrencyEnum mainCurrency) {
        this.iso = iso;
        this.iso2 = iso2;
        this.nameEn = nameEn;
        this.nameCn = nameCn;
        this.mainCurrency = mainCurrency;
    }

    public String getIso() {
        return iso;
    }

    public String getIso2() {
        return iso2;
    }

    public String getNameEn() {
        return nameEn;
    }

    public String getNameCn() {
        return nameCn;
    }

    public CurrencyEnum getMainCurrency() {
        if (Objects.isNull(mainCurrency)){
            throw new ResourceUnsupportedException("common.currency.not.supported", null);
        }
        return mainCurrency;
    }

    public static String getIsoByNameCn(String nameCn) {
        for (CountryEnum item : CountryEnum.values()) {
            if (item.getNameCn().equals(nameCn)) {
                return item.getIso();
            }
        }
        return "";
    }

    public static String getIso2ByIso(String iso)
    {
        for (CountryEnum item : CountryEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getIso2();
            }
        }
        return "";
    }

    public static CountryEnum getByNameCn(String nameCn) {
        for (CountryEnum countryEnum : CountryEnum.values()) {
            if (countryEnum.getNameCn().equals(nameCn)) {
                return countryEnum;
            }
        }
        return null;
    }

    public static String getNameCnByIso(String iso)
    {
        for (CountryEnum item : CountryEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getNameCn();
            }
        }
        return "";
    }

    public static String getNameEnByIso(String iso)
    {
        for (CountryEnum item : CountryEnum.values()) {
            if (item.getIso().equals(iso)) {
                return item.getNameEn();
            }
        }
        return "";
    }
}
